import requests


class OpenidUtils(object):

    def get_openid(self, jscode):
        url = "https://api.weixin.qq.com/sns/jscode2session?appid=wx9223657c6a1ae968&secret=bfed20955144842fe41c93991a3132f6" + "&js_code=" + jscode + "&grant_type=authorization_code"
        r = requests.get(url)
        print("522", r.json())
        openid = r.json()['openid']
        return openid
